<%@ page contentType="text/html;charset=UTF-8" isErrorPage="true" %>
<%@ page import="java.util.logging.*" %>

<%
	Throwable ex = null;
	if (exception != null)
		ex = exception;
	if (request.getAttribute("javax.servlet.error.exception") != null)
		ex = (Throwable) request.getAttribute("javax.servlet.error.exception");

	//记录日志
	Logger logger = Logger.getLogger("500.jsp");
	logger.log(Level.WARNING,ex.getMessage(), ex);
%>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
	<title>500 - Oh, Shit</title>
</head>

<body>
<div id="content">
<h3>500. Oh, Shit</h3>
<button onclick="history.back();">Back</button>
</div>

<div>
<h4>Detail:</h4>
<%
	java.io.ByteArrayOutputStream byteArrayOutputStream = new java.io.ByteArrayOutputStream();
	java.io.PrintWriter exOut = new java.io.PrintWriter(
			byteArrayOutputStream);
	ex.printStackTrace(exOut);
	exOut.flush();
	exOut.close();
%> <pre><%=byteArrayOutputStream.toString()%></pre></div>
</body>
</html>